-
Notifications
You must be signed in to change notification settings - Fork 972
feat:support cnb repo #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @jaguarliuu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
I've implemented support for CNB repositories in DeepWiki. This feature allows the application to generate wikis from code hosted on cnb.cool, expanding the range of supported platforms. A significant part of this change involved unifying the backend's approach to fetching repository data; instead of relying on platform-specific APIs, the backend now uses a generic Git clone mechanism for all supported repository types, including CNB. This simplifies the frontend logic, which no longer needs to manage different API interactions. I've also updated the user interface, documentation, and internationalization files to reflect this new capability.
Highlights
- New Feature: CNB Repository Support: DeepWiki now officially supports CNB repositories, allowing users to generate comprehensive wikis from code hosted on cnb.cool.
- Backend Unification for Repository Access: The backend has been refactored to use a unified Git clone mechanism for all repository types (GitHub, GitLab, Bitbucket, and CNB). This eliminates the need for separate API calls from the frontend for fetching repository structures, simplifying the architecture and centralizing repository access logic.
- Frontend UI and URL Parsing Enhancements: The frontend UI has been updated to include CNB as a selectable platform, and the URL parsing logic has been improved to correctly identify and handle CNB repository URLs, including complex multi-level owner paths.
- Dependency and Configuration Cleanup: Unnecessary API proxy configurations in
next.config.ts
and thehttpx
dependency inapi/requirements.txt
have been removed, contributing to a cleaner and more efficient codebase. - Documentation and Localization Updates: All relevant documentation (README.md) and internationalization files (
src/messages/*.json
) have been updated to reflect the newly added CNB support, ensuring a consistent user experience across different languages.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces support for CNB repositories, involving significant and beneficial refactoring on the frontend to delegate repository access to the backend. The changes are extensive, touching upon configuration, backend data pipelines, frontend components, and internationalization files. While the overall direction is positive, I've identified a critical issue with inconsistent repository path handling that will cause failures, along with a few medium-severity issues related to performance and repository hygiene.
.trae/TODO.md
Outdated
# TODO: | ||
|
||
- [x] 1: 检查src/app/page.tsx中parseRepositoryInput函数,确保cnb.cool被正确识别为cnb类型 (priority: High) | ||
- [x] 4: 修复src/app/page.tsx中handleGenerateWiki函数,确保URL参数中type使用解析出的type而不是selectedPlatform (priority: High) | ||
- [x] 15: 移除src/app/[owner]/[repo]/page.tsx中所有错误的API调用逻辑(GitHub、GitLab、Bitbucket、CNB等平台API) (priority: High) | ||
- [x] 16: 移除api/api.py中不必要的CNB API代理端点 (priority: High) | ||
- [x] 18: 简化前端仓库信息获取逻辑,确保只传递仓库URL和token给后端 (priority: High) | ||
- [x] 20: 移除src/app/page.tsx中CNB类型强制要求token的限制 (priority: High) | ||
- [x] 21: 移除next.config.ts中CNB API代理配置 (priority: High) | ||
- [x] 25: 修改README.md中的平台描述,将"GitHub, GitLab, or BitBucket"更新为"GitHub, GitLab, BitBucket, or CNB" (priority: High) | ||
- [x] 26: 更新src/messages/下所有语言文件中的平台描述,添加CNB支持 (priority: High) | ||
- [x] 17: 移除api/requirements.txt中不必要的httpx依赖 (priority: Medium) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"api_key": "${OPENAI_API_KEY}", | ||
"base_url": "${OPENAI_BASE_URL}" | ||
}, | ||
"batch_size": 10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The batch_size
has been drastically reduced from 500 to 10. This change may significantly degrade the performance of the document embedding process by increasing the number of API calls required. If this reduction is necessary for stability or model constraints, it would be beneficial to add a comment explaining the reason.
@CodiumAI-Agent /improve |
PR Code Suggestions ✨
|
5000+ files changes, you are including some modules not covered by the gitignore. Remove it if possible. |
PR Code Suggestions ✨No code suggestions found for the PR. |
No description provided.